--[[
@FileName: GTWindowForm
@Date:     2018-04-10 04/10/18
@Author:   zhangpenghui
@Description:
]]

local GTWindowForm = class("GTWindowForm",LuaNGUIForm)

function GTWindowForm:OnInit(form, userData)
	Log.Info("GTWindowForm-----OnInit")
	self.FingerUI = self.GameObjects[0]    
	self.LeftTopUI = self.GameObjects[1]
	self.BgUITransform = self.Transforms[0]
	self.ScaleFlag = false;
	self.CurScale = 1.0;
end

function GTWindowForm:OnOpen(userData)
	LuaEntry.RegisterUpdate(self)
	--GameEntry.Event:Fire(nil, ReferencePool.Acquire(typeof(PS.HideUIEventArgs)):Fill(PS.HideUIEventArgs.HideMode.Except, tonumber(self:GetSid())))
end

function GTWindowForm:OnUpdate(dt, udt)
	if self.ScaleFlag then
		local perAdd = 0.05
		if self.CurScale < 20 then
			self.CurScale = self.CurScale + perAdd
			self.BgUITransform.localScale = Vector3(self.CurScale, self.CurScale, 1)
			self.BgUITransform.localPosition = Vector3(self.BgUITransform.localPosition.x+2.4*(perAdd/0.02), self.BgUITransform.localPosition.y-1.2*(perAdd/0.02), 0)  
		end
	end
end

function GTWindowForm:OnClick(gameObject)
	Log.Debug("GTWindowForm:OnClick")
	self.LeftTopUI:SetActive(false) 
	self.FingerUI:SetActive(false)
	self.ScaleFlag = true
end

function GTWindowForm:OnCloseEvent()
	self:Close()
end

return GTWindowForm


